package com.aliyun.flashsale.client.service;

import javax.validation.constraints.Min;

import com.aliyun.commons.model.Result;
import com.aliyun.flashsale.client.model.FlashSaleProductDTO;
import org.springframework.validation.annotation.Validated;

/**
 * 秒杀商品服务
 *
 * 
 * @date 2024/11/27
 */
@Validated
public interface FlashSaleProductService {

    /**
     * 按 ID 获取秒杀商品信息
     *
     * @param flashSaleProductId 秒杀商品ID
     * @return {@link FlashSaleProductDTO }
     */
    Result<FlashSaleProductDTO> getFlashSaleProduct(@Min(value = 1, message = "商品ID无效") long flashSaleProductId);

    /**
     * 重置缓存
     *
     * @param flashSaleProductId 秒杀商品ID
     * @return {@link Result }<{@link Void }>
     */
    Result<Void> resetCache(Long flashSaleProductId);
}